﻿@model mvcForum.Web.ViewModels.Create.CreateMessageViewModel
@using mvcForum.Web.Helpers;
@{
	ViewBag.Title = ForumHelper.GetString("CreateMessage.Title", new { Title = Model.Topic.Title });

	Layout = Url.GetThemeBaseUrl() + "areas/forum/views/shared/forumlayout.cshtml";
}
	<!-- Views/Forum/CreateMessage.cshtml -->
@Html.Partial("Breadcrumb", Model.Path)

	<h2>@Model.Topic.Title</h2>

	<div class="row">
		<div class="col-md-12">
			@using (Html.BeginForm("create", "message", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal" })) {
				@Html.HiddenFor(t => t.TopicId)
				@Html.HiddenFor(t => t.ReplyTo)
				<h3>@ForumHelper.GetString("CreateMessage.PostNewMessage")</h3>
				<div class="form-group">
					@Html.LabelFor(t => t.Subject, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.TextBoxFor(t => t.Subject, new { @class = "form-control" })
					</div>
				</div>
				<div class="form-group">
					<label for="editor" class="col-lg-2 control-label">@ForumHelper.GetString("CreateMessage.Message", null, "mvcForum.Web")</label>
					<div class="col-lg-10">
						@Html.Partial(ForumHelper.GetEditorString() + "Editor", String.IsNullOrEmpty(Model.Body) ? "" : Model.Body)
					</div>
				</div>
	if (Model.Topic.CanUpload) {
				<div class="form-group">
					<label for="files" class="col-lg-2 control-label">@ForumHelper.GetString("CreateMessage.AttachFile", null, "mvcForum.Web")</label>
					<div class="col-lg-10">
						<input type="file" id="files" name="files" class="btn" />
					</div>
				</div>
	}
				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-10">
						<button type="submit" class="btn btn-primary">@ForumHelper.GetString("CreateMessage.Submit")</button>
					</div>
				</div>
			}		
		</div>
	</div>
@Html.Partial("OlderPosts", Model)
@if (ForumHelper.Debug) {
<!-- For Selenium Test -->
<div id="forum_message_create" style="display: none;"></div>
}

@section scripts {
	@Html.Partial(ForumHelper.GetEditorString() + "Scripts", String.IsNullOrEmpty(Model.Body) ? "" : Model.Body)
}
@section styles {
	@Html.Partial(ForumHelper.GetEditorString() + "Styles", String.IsNullOrEmpty(Model.Body) ? "" : Model.Body)
}